<!DOCTYPE html>
<html>
<head>
	<title></title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
	<style type="text/css">
		table.hovertable {
			font-family: verdana,arial,sans-serif;
			font-size:11px;
			color:#333333;
			border-width: 1px;
			border-color: #999999;
			border-collapse: collapse;
		}
		table.hovertable th {
			background-color:#c3dde0;
			border-width: 1px;
			padding: 8px;
			border-style: solid;
			border-color: #a9c6c9;
		}
		table.hovertable tr {
			background-color:#d4e3e5;
		}
		table.hovertable td {
			border-width: 1px;
			padding: 8px;
			border-style: solid;
			border-color: #a9c6c9;
		}
		td {min-width:80px;max-width: 150px;}
		input {min-width:80px;max-width: 150px;}
</style>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=LK6kev5Xr9gWIlUpNbF1fYiv6nmCh3dF"></script>
</head>
<body>
	<div style="display: inline-block; margin-top: 50px;margin-left: 30px" >
	<form id="shopsform"  name= "shopsform" method = 'post' action="__SELF__">
		<table class="hovertable">
			<tr onmouseover="this.style.backgroundColor='#ffff66';" onmouseout="this.style.backgroundColor='#d4e3e5';">
				<td>商户名</td><td><input type="text" id="bs_name" name="bs_name" value="{$info.bs_name}"></td>			
			</tr>
			<tr onmouseover="this.style.backgroundColor='#ffff66';" onmouseout="this.style.backgroundColor='#d4e3e5';">
				<td>店名</td><td><input type="text" id="shopname" name="shopname" value="{$info.shopname}"></td>
			</tr>
			<tr onmouseover="this.style.backgroundColor='#ffff66';" onmouseout="this.style.backgroundColor='#d4e3e5';">
				<td>行业</td><td><input type="text" id="type" name="type" value="{$info.type}"></td>
			</tr>
			<tr onmouseover="this.style.backgroundColor='#ffff66';" onmouseout="this.style.backgroundColor='#d4e3e5';">
				<td>地址</td><td><input type="text" id="address" name="address" value="{$info.address}"></td>
			</tr>
			<tr onmouseover="this.style.backgroundColor='#ffff66';" onmouseout="this.style.backgroundColor='#d4e3e5';">
				<td>评分</td><td>{$info.score}</td>
			</tr>
			<tr onmouseover="this.style.backgroundColor='#ffff66';" onmouseout="this.style.backgroundColor='#d4e3e5';">
				<td>网址</td><td><input type="text" id="homepage" name="homepage" value="{$infoext.homepage}"></td>
			</tr>
			<tr onmouseover="this.style.backgroundColor='#ffff66';" onmouseout="this.style.backgroundColor='#d4e3e5';">
				<td>电话</td><td><input type="text" id="phone" name="phone" value="{$infoext.phone}"></td>
			</tr>
		
		
		</table>
		<input type="submit" value="确定修改" />
		</form>

	</div>
	<div style="display: inline-block;position: absolute;left:400px;">
		<h4>可点击下面地图选择地址</h4>
		<div id="allmap" style="width:700px;height:400px;"></div>
	</div>
	<script src="http://cdn.bootcss.com/jquery/1.9.0/jquery.js"></script>
	
	<script type="text/javascript">
	// 百度地图API功能
	var map = new BMap.Map("allmap");
	map.centerAndZoom(new BMap.Point(109.95, 27.52), 11);
	//单击获取点击的经纬度
	map.addEventListener("click",function(e){
		
		remove_overlay();
		var point = new BMap.Point(e.point.lng,e.point.lat);
		var gc = new BMap.Geocoder();
		gc.getLocation(point, function(rs){
		   	var addComp = rs.addressComponents;
		   	var addr=addComp.province + ", " + addComp.city + ", " + addComp.district + ", " + addComp.street + ", " + addComp.streetNumber;
		   	if(confirm("确定要修改地址为  '"+addr+"'")){
		   		//把表格中地址的值改成地图选择后的值
		   		$("#address").val(addr);
		   		// $("#lon").val(e.point.lng);
		   		// $("#lat").val(e.point.lat);
			}	
		});
		var marker = new BMap.Marker(point);  // 创建标注
		map.addOverlay(marker);               // 将标注添加到地图中
		marker.setAnimation(BMAP_ANIMATION_BOUNCE); //跳动的动画
	});               
	map.enableScrollWheelZoom();   //启用滚轮放大缩小，默认禁用
	map.enableContinuousZoom();    //启用地图惯性拖拽，默认禁用
	//清除覆盖物
	function remove_overlay(){
		map.clearOverlays();         
	}	
</script>

</body>
</html>


